package com.ticket.system.domain.enu;

import lombok.Getter;

/**
 * @ClassName : OrderDetailStatusEnum
 * @Description :
 * @Author : lixiang
 * @Date: 2024/1/2  16:10
 */

@Getter
public enum OrderDetailStatusEnum {
    ONE(1,"已占票等待支付"),
    TWO(2,"已支付"),
    THREE(3,"超时未支付自动取消"),
    FOUR(4,"已验票"),
    FIVE(5,"已支付等待退款"),
    SIX(6,"已退款"),
    SEVEN(7,"退款中");

    private final int code;

    private final String value;

    OrderDetailStatusEnum(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public static OrderDetailStatusEnum indexOf(Integer code) {
        for (OrderDetailStatusEnum obj : OrderDetailStatusEnum.values()) {
            if (code.equals(obj.getCode())) {
                return obj;
            }
        }
        return null;
    }

    public static OrderDetailStatusEnum indexOfMsg(String msg) {
        for (OrderDetailStatusEnum obj : OrderDetailStatusEnum.values()) {
            if (msg.equals(obj.getValue())) {
                return obj;
            }
        }
        return null;
    }

}
